<template>
  <div class="side-bar">
    <el-menu
      router='true'
      :collapse="isCollapse"
      default-active="/"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#56B8F3"
    >
      <el-menu-item index="/">
        <i class="el-icon-menu"></i>
        <span slot="title">首页</span>
      </el-menu-item>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-document"></i>
          <span>数据管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="/usermanage">用户管理</el-menu-item>
          <el-menu-item index="/articlemanage">文章管理</el-menu-item>
        </el-menu-item-group>
        <el-menu-item index="2-3">分类管理</el-menu-item>
      </el-submenu>

      <el-menu-item index="/limitmanage">
        <i class="el-icon-s-platform"></i>
        <span slot="title">权限管理</span>
      </el-menu-item>
      <el-menu-item index="/setting">
        <i class="el-icon-setting"></i>
        <span slot="title">设置</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: false,
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style>
</style>